import { ShaderChunk } from "three";

const CombineShader = {
  name: 'CombineShader',

  uniforms: {
    tDiffuse: { value: null },
    strength: { value: 1.0 },
  },

  vertexShader: /* glsl */ `
        ${ShaderChunk.common}
        ${ShaderChunk.logdepthbuf_pars_vertex}
		varying vec2 vUv;

		void main() {

			vUv = uv;
			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
            ${ShaderChunk.logdepthbuf_vertex}
		}`,

  fragmentShader: /* glsl */ `
        ${ShaderChunk.logdepthbuf_pars_fragment}
		uniform float strength;

		uniform sampler2D tDiffuse;

		varying vec2 vUv;

		void main() {

			vec4 texel = texture2D( tDiffuse, vUv );
			gl_FragColor = strength * texel;
            ${ShaderChunk.logdepthbuf_fragment}
		}`,
};

export default CombineShader;
